package fr.jgraph.model.vertex;

public abstract class VertexFactory {
	private VertexDefinition vertexDef;

	public VertexFactory(VertexDefinition def) {
		vertexDef = def;
	}

	public Vertex createVertex(Object content) {
		Vertex vertex = initVertex(content);

		if (vertexDef.isMarkable())
			vertex = new MarkableVertex(vertex);

		return vertex;
	}

	protected abstract Vertex initVertex(Object content);
}
